/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * | 计算内容区域高度，需传入头部class,内容区域class/id
 * +----------------------------------------------------------------------
 */
layui.define(['jquery'], function (exports) {
    var $ = layui.jquery;
    var titleHeight;
    var parentHeight;
    var contentHeight;
    var allHeight = {
        init: function (titleClass, content) {
            var title = $(titleClass);
            titleHeight = title.outerHeight();
            parentHeight = title.parent().height();
            contentHeight = parentHeight - titleHeight;
            $(content).height(contentHeight);
        },
        init1: function (titleClass, content) {
            var title = $(titleClass);
            titleHeight = title.outerHeight();
            parentHeight = title.parent().height();
            contentHeight = parentHeight - titleHeight-titleHeight;
            $(content).height(contentHeight);
        },
        init2: function (titleClass, content) {
            var title = $(titleClass);
            titleHeight = title.outerHeight();
            parentHeight = title.parent().height();
            $(content).height(parentHeight);
        },
        count:function(titleClass, content){//计算
            var title = $(titleClass);
            titleHeight = title.outerHeight();
            parentHeight = $(content).parent().height();
            contentHeight = parentHeight - titleHeight;
            return contentHeight
        }
    };
    exports('allHeight', allHeight);
});
